//
//  SetTableViewCell.m
//  Products_B
//
//  Created by lanou on 16/6/4.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "SetTableViewCell.h"

@interface SetTableViewCell() {
    UILabel *_leftLabel;
}
@end

@implementation SetTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, kWidth / 2, 20)];
        _leftLabel.font = [UIFont systemFontOfSize:15];
        _leftLabel.alpha = 0.8;
        [self.contentView addSubview:_leftLabel];
    }
    return self;
}

- (void)setIndexPath:(NSIndexPath *)indexPath {
    _indexPath = indexPath;
    if (indexPath.section == 0) {
        _leftLabel.text = @"分享给好友";
    }
    if (indexPath.section == 1) {
        if (indexPath.row == 0) {
            _leftLabel.text = @"关于我们";
            _vLabel = [[UILabel alloc] initWithFrame:CGRectMake(kWidth - 100, 10, 60, 20)];
            _vLabel.text = @"V4.4";
            _vLabel.textAlignment = NSTextAlignmentCenter;
            _vLabel.font = [UIFont systemFontOfSize:12];
            _vLabel.alpha = 0.6;
            [self.contentView addSubview:_vLabel];
            
        } else {
            _leftLabel.text = @"给我们打分";
        }
    }
    if (indexPath.section == 2) {
        if (indexPath.row == 0) {
            _leftLabel.text = @"意见反馈";
        } else if (indexPath.row == 1) {
            _leftLabel.text = @"清理缓存";
            _cacheLabel = [[UILabel alloc] initWithFrame:CGRectMake(kWidth - 80, 10, 60, 20)];
            _cacheLabel.text = @"0.0MB";
            _cacheLabel.textAlignment = NSTextAlignmentCenter;
            _cacheLabel.font = [UIFont systemFontOfSize:12];
            _cacheLabel.alpha = 0.6;
            [self.contentView addSubview:_cacheLabel];
            
        } else {
            _leftLabel.text = @"社区规则";
        }
    }
    if (indexPath.section == 3) {
        _leftLabel.frame = CGRectMake(0, 10, kWidth, 20);
        _leftLabel.text = @"退出登录";
        _leftLabel.textAlignment = NSTextAlignmentCenter;
    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
